package com.greenline.push.core.pushcenter.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.greenline.push.core.pushcenter.GroupAppManager;
import com.greenline.push.dal.pushcenter.GroupAppDao;
import com.greenline.push.dal.pushcenter.dataobject.GroupAppDO;
import com.greenline.push.dal.query.GroupAppQuery;

/**
 * 
 * @Type GroupAppManagerImpl
 * @Desc GroupAppManagerImpl crud
 * @author shuai.zuo
 * @date 2014年10月10日
 * @Version V1.0
 */
public class GroupAppManagerImpl implements GroupAppManager {
    @Autowired
    private GroupAppDao groupAppDao;

    @Override
    public Long insert(GroupAppDO GroupAppDO) {
        return groupAppDao.insert(GroupAppDO);
    }

    @Override
    public boolean update(GroupAppDO GroupAppDO) {
        if (null == GroupAppDO) {
            return false;
        }
        return groupAppDao.update(GroupAppDO) > 0;
    }

    @Override
    public GroupAppQuery listByQuery(GroupAppQuery query) {
        return groupAppDao.listByQuery(query);
    }

    @Override
    public GroupAppDO getById(Long id) {
        return groupAppDao.getById(id);
    }

    @Override
    public boolean delete(Long id) {
        if (null == id) {
            return false;
        }
        return groupAppDao.deleteById(id) > 0;
    }

    @Override
    public List<GroupAppDO> listByAppId(Long appId) {
        return groupAppDao.listByAppId(appId);
    }

}
